package com.wzw.springboot.principle.use.security.infrastructure.provider;

import com.wzw.springboot.principle.use.security.enums.AuthenticationEnum;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.AuthenticationException;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * @author Wangzhiwen
 */
public class QrCodeAuthenticationProvider extends AbstractGeneralAuthenticationProvider<QrCodeAuthenticationToken> {
    // 凭证检查

    @Override
    protected AuthenticationEnum getEnum() {
        return AuthenticationEnum.QR;
    }

    // 返回认证成功的对象
    @Override
    protected Authentication createSuccessAuthentication(Object principal, Authentication authentication, UserDetails user) {
        return null;
    }

    // 得到UserDetails
    @Override
    protected UserDetails retrieveUser(String uuid, QrCodeAuthenticationToken authentication) throws AuthenticationException {
        return null;
    }

    // 是否支持
    @Override
    public boolean supports(Class<?> authentication) {
        return QrCodeAuthenticationProvider.class.isAssignableFrom(authentication);
    }
}
